package com.topera.demo.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * Excel读监听器  读取操作在这里执行
 */
public class ExcelListen extends AnalysisEventListener<DemoData> {

    //一行一行的读
    @Override
    public void invoke(DemoData data, AnalysisContext analysisContext) {
        System.out.println(data);
    }

    //读取表头信息
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头"+headMap);
    }

    //读取完之后的操作
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
